/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package management;

import entity.Menu;
import entity.ViewCart;
import java.sql.PreparedStatement;
import java.util.ArrayList;
import javax.swing.JOptionPane;

/**
 *
 * @author Windows7
 */
public class ManagerViewCart {

    static ArrayList<ViewCart> listCart = new ArrayList<ViewCart>();

    public static ArrayList<ViewCart> addViewCart(ViewCart vc) {
        try {
            Float pr = Float.valueOf(vc.getMenuPrice());
            int num = Integer.valueOf(vc.getNumber());
            int id = vc.getMenu_Id();
            String name = String.valueOf(vc.getMenu());
            float total = pr * num;
            vc.setMenu_Id(id);
            vc.setMenu(name);
            vc.setMenuPrice(pr);
            vc.setNumber(num);
            vc.setTotal(total);
            listCart.add(vc);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return listCart;
    }
}
